import { useCallback } from 'react'
import { KeyLabelEnum } from '@/types'
import { EnumUtil } from '@/utils'

/**
 * 枚举表格Render
 * @param enumDef 枚举定义
 */
export const useEnumRender = (enumDef: KeyLabelEnum) => {
  return useCallback(
    (value: string) => {
      return EnumUtil.getEnumLabel(enumDef, value)
    },
    [enumDef]
  )
}
